{% extends "layout.html" %}

{%- block title -%}Welcome {%- endblock -%}

{% block head %}
	{{ super() }}
{% endblock %}

{%- block extrastyles -%}
	<style type="text/css">
	</style>
{%- endblock -%}

{%- block extrascripts -%}
	<script type="text/javascript" src="/static/js/jquery.js"></script>
	<script type="text/javascript">
		$(function() { 
			
			var first = function() { $(".sorry0").fadeIn(1000).css({display: "block"}), setTimeout(second, 5000) };
			var second = function() { $(".sorry1").fadeIn(1000).css({display: "block"}), setTimeout(third, 3000) };
			var third = function() { $(".sorry2").fadeIn(1000).css({display: "block"}), setTimeout(fourth, 2500) };
			var fourth = function() { $(".sorry3").fadeIn(1000).css({display: "block"}) };
			setTimeout(first, 3000);
			
		});
	</script>
{%- endblock -%}

{% block content %}
	<div class="container">
	
		<h1 class="center bigTitle">This is your result.</h1>		
		<span class='sorry0 hide'> SO!? </span> 
		<span class='sorry1 hide'> Ok, I am gonna leave you alone to your self.</span> 
		<span class='sorry2 hide'>If it helps, sorry man. Better luck next time.</span>
		<span class='sorry3 hide'>Oh!, and one last thing, the examination form fee is going to double every year from now on. *sad face*</span>
		
		<div class="row" style="margin: 30px 0 30px 0;">
			
			<table class="table table-striped table-bordered table-condensed">
				<tbody>
					<tr>
						<td colspan="2"> <strong>PERSONAL DETAIL</strong> </td>
					</tr>
					{% set personal_details = [
							('Candidate Name', candidate_name|title), 
							('Gender', gender|capitalize), 
							('State Of Origin', state_of_origin|upper), 
							('Registration Number', registration_number|upper), 
							('Examination Number', examination_number), 
							('Examination Center', examination_centre|title) 
						] 
					%}
					{% for detail in personal_details %}
						<tr>
							<td> {{ detail[0] }} </td>
							<td> {{ detail[1] }} </td>
						</tr>
					{% endfor %}
        </tbody>
			</table>
			
			<table class="table table-striped table-bordered table-condensed">
				<tbody>
					<tr>
						<td colspan="2"> <strong>EXAMINATION RESULT<strong> </td>
					</tr>
					{% set examination_results = [
							(result1),
							(result2),
							(result3),
							(result4)
						] 
					%}
					<tr>
						{% for result in examination_results %}						
								<td> <strong>{{ result|title }}</strong> </td>						
						{% endfor %}
						<td> <strong>Aggregate = {{ aggregate }}</strong> </td>						
					</tr>
        </tbody>
			</table>
			
			<table class="table table-striped table-bordered table-condensed">
				<tbody>
					<tr>
						<td colspan="2"> <strong>CHOICES</strong> </td>
					</tr>
					{% set choices_set = [
							[
								[
									('Institution Type', choice1_ms_itype),
									('Institution', choice1_ms_institution),
									('Course', choice1_ms_course),
									('Faculty', choice1_ms_faculty),
								],
								[
									('Institution Type', choice1_mr_itype),
									('Institution', choice1_mr_institution),
									('Course', choice1_mr_course),
								],
								[
									('Institution Type', choice1_p_itype),
									('Institution', choice1_p_institution),
									('Course', choice1_p_course),
								]
							],
							[
								[
									('Institution Type', choice2_ms_itype),
									('Institution', choice2_ms_institution),
									('Course', choice2_ms_course),
									('Faculty', choice2_ms_faculty),
								],
								[
									('Institution Type', choice2_mr_itype),
									('Institution', choice2_mr_institution),
									('Course', choice2_mr_course),
								],
								[
									('Institution Type', choice2_p_itype),
									('Institution', choice2_p_institution),
									('Course', choice2_p_course),
								]
							]
						] 
					%}
					{% set choice_cycler = cycler('First Choice Institutions', 'Second Choice Institutions') %}
					{% set choice_type_cycler = cycler('Most Preferred Choice', 'More Preferred Choice', 'Preferred Choice') %}
        </tbody>
			</table>
			
			<div class="row">
			{% for choices in choices_set %}										
				<div class='span6'>
					<table class="table table-striped table-bordereds table-condensed">
						<tbody>
							<tr>
								<td><strong><h4>{{ choice_cycler.__next__() }}:</h4><strong></td>
							</tr>													
							{% for choice in choices %}
								<tr>
									<td><strong>{{ choice_type_cycler.__next__() }}:</strong></td>
								</tr>
								<tr>
								{% for c in choice %}
									<tr>
										<td>{{ c[0] }}: {{ c[1] }} </td>
									</tr>
								{% endfor %}
								</tr>
							{% endfor %}						
						</tbody>
					</table>
				</div>
			{% endfor %}			
			</div>		
			
		</div>		
		
	</div>
	<script type="text/javascript">
		$(function() {});
	</script>
{% endblock %}